package com.fr.chart.core.glyph;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.GeneralGlyph;
import com.fr.report.io.xml.ReportXMLUtils;
import java.awt.Shape;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class ShapeGlyph extends GeneralGlyph
{
  private static final long serialVersionUID = 2660521209361595133L;
  public static final String XML_TAG = "ShapeGlyph";
  private Shape shape;

  public ShapeGlyph()
  {
  }

  public ShapeGlyph(Shape paramShape)
  {
    this.shape = paramShape;
  }

  public void setShape(Shape paramShape)
  {
    this.shape = paramShape;
  }

  public Shape getShape()
  {
    return this.shape;
  }

  public Shape getOutline4Fill()
  {
    return getShape();
  }

  public Iterator selectableChildren()
  {
    return Collections.EMPTY_LIST.iterator();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
      this.shape = ReportXMLUtils.readShape(paramXMLableReader);
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("ShapeGlyph");
    super.writeXML(paramXMLPrintWriter);
    if (getShape() != null)
      ReportXMLUtils.writeShape(paramXMLPrintWriter, getShape());
    paramXMLPrintWriter.end();
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof ShapeGlyph))
      return false;
    ShapeGlyph localShapeGlyph = (ShapeGlyph)paramObject;
    if (!(super.equals(localShapeGlyph)))
      return false;
    return (Equals.euqalsShape(localShapeGlyph.getShape(), getShape()));
  }
}